﻿using System;
using System.Net.Http;

namespace ConsoleApp_test
{
    public class WebHelp
    {
        public static void GetApi(string url)
        {
            using (var client = new HttpClient())
            {
                try
                {
                    var resTask = client.GetAsync(url);
                    resTask.Wait();
                    if (resTask.Result.IsSuccessStatusCode)
                        Console.WriteLine($"[url:{url}] ----> Ok");
                    else
                    {
                        Console.WriteLine($"[url:{url}] ----> Faild");
                    }
                }
                catch (Exception)
                {
                    Console.WriteLine($"[url:{url}] ----> Error");
                }
            }
        }


    }
}